<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="jakarta.faces.core"
                xmlns:ui="jakarta.faces.facelets" xmlns:p="http://primefaces.org/ui"
                template="/template_pop.xhtml"
                xmlns:h="jakarta.faces.html">
    <ui:define name="content">
        <title>#{sysParamMB.editObj.id ==null ? sms['button.new'] : sms['button.edit']}#{sms['sys.parameter.title']}</title>
        <h:inputHidden value="#{sysParamMB.editObj.id}"/>
          <!--<p:growl id="growl" showDetail="true" />-->
      <div class="field grid">
            <p:outputLabel for="name" class="col-fixed" style="width:100px"
                           dir="RTL">#{sms['sys.parameter.name']}</p:outputLabel>
            <div class="col">
                <p:inputText id="name" value="#{sysParamMB.editObj.name}" required="true" >

                    <f:validateLength minimum="2" maximum="5"/>
                    <p:clientValidator event="keyup"/>

                </p:inputText>
                <p:message for="@previous" />
            </div>

        </div>
        <div class="field grid">
            <p:outputLabel for="key_" class="col-fixed" style="width:100px"
                           dir="RTL">#{sms['sys.parameter.key']}</p:outputLabel>
            <div class="col">
                <p:inputText id="key_" value="#{sysParamMB.editObj.key}" required="true"  validator="#{sysParamMB.keyUniqValidate}"/>
                <p:message for="@previous"/>
            </div>
        </div>
        <div class="field grid">
            <p:outputLabel for="value" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.parameter.value']}
            </p:outputLabel>
            <div class="col">
                <p:inputText id="value" value="#{sysParamMB.editObj.value}" required="true"/>
                <p:message for="@previous"/>
            </div>
        </div>
        <div class="field grid">
            <p:outputLabel for="@next" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.parameter.state']}
            </p:outputLabel>
            <div class="col">
                <p:selectOneMenu id="state" style="width:100px" value="#{sysParamMB.editObj.state}" required="true">
                    <f:selectItem itemLabel="" itemValue="#{null}"/>
                    <f:selectItem itemLabel="#{sms['common.yes']}" itemValue="true"/>
                    <f:selectItem itemLabel="#{sms['common.no']}" itemValue="false"/>
                </p:selectOneMenu>
                <p:message for="@previous"/>
            </div>
        </div>
        <div class="field grid">
            <p:outputLabel for="remark" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.parameter.remark']}
            </p:outputLabel>
            <div class="col">
                <p:inputTextarea id="remark" value="#{sysParamMB.editObj.remark}" rows="6" cols="33"/>
            </div>
        </div>

        <br/>

        <div class="flex">
            <p:commandButton value="#{sms['button.submit']}" update="@form" type="submit" validateClient="true" ajax="true"
                             action="#{sysParamMB.save}"
                             class="flex-2 border-round mx-4" >
             
            </p:commandButton>
            <p:commandButton value="#{sms['button.cancel']}"  
                             action="#{sysParamMB.closeDialog()}"
                             class="flex-2 border-round mx-4" rendered="#{sysParamMB.editObj.id!=null}" >
             
            </p:commandButton>


        </div>


    </ui:define></ui:composition>